<%@ include file="/common/taglibs.jsp"%>
<header>
    <title><s:text name="eml.dataset"/> - <s:text name="eml.dataset.creator"/></title>
</header>

<h1><s:text name="eml.dataset"/> - <s:text name="eml.dataset.creator"/></h1>

<s:form id="editCreatorForm" action="initCreator" method="post" validate="false">

<s:set name="eml" value="eml" scope="request"/>
<fieldset id="creator" class="metadata">
<legend><s:text name="eml.dataset.creator"/></legend>
<input type="hidden" name="eml.dataset.creator.scope" value="document"/>
<s:textfield key="eml.dataset.creator.individualName.givenName" required="true" cssClass="text medium"/>
<s:textfield key="eml.dataset.creator.individualName.surName" required="true" cssClass="text medium"/>
<s:textfield key="eml.dataset.creator.organizationName" required="true" cssClass="text medium"/>
<s:textfield key="eml.dataset.creator.positionName" required="true" cssClass="text medium"/>
<div id="wwlbl_editCreatorForm_eml_dataset_creator_role" class="wwlbl">
	<label for="editCreatorForm_eml_dataset_creator_role" class="desc">
		<s:text name="eml.dataset.creator.role"/>
		<!-- <span class="req">*</span> -->
	</label>        
</div> 
<div id="wwctrl_editCreatorForm_eml_dataset_creator_role" class="wwctrl">
	<s:set name="creatorRoles" value="creatorRoles"/>
	<select id="eml.dataset.creator.role" name="eml.dataset.creator.role" class="text medium">
		<s:iterator value="creatorRoles" status="roleStatus">
            <s:set name="role"><s:property/></s:set>
			<option value="<s:text name="%{role}"/>" <s:if test="%{getText(#role)==eml.dataset.creator.role}">selected="true"</s:if>>
              <s:text name="%{role}"/>
            </option>
		</s:iterator>
	</select>
</div>
</fieldset>

<fieldset id="creatorContactDetails" class="metadata">
<legend><s:text name="eml.dataset.creator.contactdetails"/></legend>
<input type="hidden" name="eml.dataset.creator.address.scope" value="system"/>
<s:textfield key="eml.dataset.creator.address.deliveryPoint" required="false" cssClass="text large"/>
<s:textfield key="eml.dataset.creator.address.city" required="false" cssClass="text medium"/>
<s:textfield key="eml.dataset.creator.address.postalCode" required="false" cssClass="text medium"/>
<li id="wwgrp_editCreatorForm_eml_dataset_creator_address_country" class="wwgrp">
<div id="wwlbl_editCreatorForm_eml_dataset_creator_address_country" class="wwlbl">
	<label for="editCreatorForm_eml_dataset_creator_address_country" class="desc">
		<s:text name="eml.dataset.creator.address.country"/>
		<!-- <span class="req">*</span> -->
	</label>        
</div> 
<div id="wwctrl_editCreatorForm_eml_dataset_creator_address_country" class="wwctrl">
	<appfuse:country 
		name="eml.dataset.creator.address.country" 
		prompt="-- Any country ---" 
		default="${eml.dataset.creator.address.country}"/>
</div> 	
</li>
<% //phone and fax are mapped to the model in the action code %>
<s:textfield key="creator.phone" label="%{getText('eml.dataset.creator.phone')}" value="%{eml.dataset.creator.sizePhoneList()>0 ? eml.dataset.creator.getPhone(0).getBase() : ''}" required="false" cssClass="text medium"/>
<s:textfield key="creator.fax" label="%{getText('eml.dataset.creator.fax')}" value="%{eml.dataset.creator.sizePhoneList()>1 ? eml.dataset.creator.getPhone(1).getBase() : ''}" required="false" cssClass="text medium"/>

<s:textfield key="eml.dataset.creator.electronicMailAddress" required="false" cssClass="text medium"/>
<s:textfield key="eml.dataset.creator.onlineUrl" required="false" cssClass="text medium"/>
</fieldset>

<li class="buttonBar bottom">
<s:submit cssClass="button" key="button.cancel" theme="simple" method="cancel"/>
<s:submit cssClass="button" key="button.back" theme="simple" method="back"/>
<s:submit cssClass="button" key="button.next" theme="simple"/>
</li>

</s:form>